<template>
  <div class='search'>
    <f-form ref='form' :action='api.bod' :form-key='this.formItem.orderDetailsId'>
      <a-divider orientation='center'>市场保证金</a-divider>
      <f-form-item label='市场保证金' type='number' :precision='4' data-type='number' name='customBond' :value='formItem.customBond' />
      <f-form-item label='保证金多收' type='number' :precision='4' :min='-100' data-type='number' name='customOverBond' :value='formItem.customOverBond' />
      <a-divider orientation='center'>退市场保证金</a-divider>
      <f-form-item label='退市场保证金' type='number' :precision='4' data-type='number' name='returnCustomBond' :value='formItem.returnCustomBond' />
      <f-form-item label='退保证金日期' type='date' name='customBondRetDate' :value='formItem.customBondRetDate' />

      <a-divider orientation='center'>市场回款</a-divider>
      <f-form-item label='回款金额' type='number' :precision='4' data-type='number' name='returnAmount' :value='formItem.returnAmount' />
      <f-form-item label='预付款' type='number' :precision='4' :min='-1000000' data-type='number' name='customYsk' :value='formItem.customYsk' />
      <f-form-item label='回款日期' type='date' name='returnDate' :value='formItem.returnDate' />
      <f-form-item label='认款日期' type='date' name='renkuanDate' :value='formItem.renkuanDate' />
      <a-divider orientation='center'>厂家垫付款</a-divider>
      <f-form-item label='应垫付款金额' type='number' :precision='4' data-type='number' name='supplierBond' :value='formItem.supplierBond' />
      <f-form-item label='实垫付款金额' type='number' :precision='4' data-type='number' name='supplierPayBond' :value='formItem.supplierPayBond' />
      <f-form-item label='垫付日期' type='date' name='supplierBondPayDate' :value='formItem.supplierBondPayDate' />

      <a-divider orientation='center'>厂家返款</a-divider>
      <f-form-item label='厂家应返金额' type='number' :precision='4' :min='-1000000' data-type='number' name='supplierRetable' :value='formItem.supplierRetable' />
      <f-form-item label='厂家实返金额' type='number' :precision='4' :min='-1000000' data-type='number' name='supplierRealAmount' :value='formItem.supplierRealAmount' />
      <f-form-item label='返款日期' type='date' name='supplierRetDate' :value='formItem.supplierRetDate' />

      <a-divider orientation='center' v-if='formItem.companyId==4'>厂家返款2</a-divider>
      <f-form-item label='厂家应返金额2' type='number' :precision='4' :min='-1000000' data-type='number' name='supplierRetable2' :value='formItem.supplierRetable2' v-if='formItem.companyId==4'/>
      <f-form-item label='厂家实返金额2' type='number' :precision='4' :min='-1000000' data-type='number' name='ldSupplierRealAmount' :value='formItem.ldSupplierRealAmount' v-if='formItem.companyId==4'/>
      <f-form-item label='返款日期2' type='date' name='ldSupplierRetDate' :value='formItem.ldSupplierRetDate' v-if='formItem.companyId==4'/>



      <a-divider orientation='center'>厂家退垫付款</a-divider>
      <f-form-item label='退垫付款金额' type='number' :precision='4' data-type='number' name='returnSupplierBond' :value='formItem.returnSupplierBond' />
      <f-form-item label='退垫付日期' type='date' name='supplierRetBondDate' :value='formItem.supplierRetBondDate' />



      <a-divider orientation='center'>结算信息</a-divider>
      <f-form-item label='结算高开税金' type='number' :precision='4' data-type='number' name='customSettleGapUpAmount' :value='formItem.customSettleGapUpAmount' />
      <f-form-item label='应结算金额' type='number' :precision='4' data-type='number' name='settleAmount' :value='formItem.settleAmount' />
      <f-form-item label='应结算金额2' type='number' :precision='4' data-type='number' name='settleAmount2' :value='formItem.settleAmount2' />
      <f-form-item label='应结算金额3' type='number' :precision='4' data-type='number' name='settleAmount3' :value='formItem.settleAmount3' />
      <f-form-item label='已结算金额' type='number' :precision='4' data-type='number' name='settleRealAmount' :value='formItem.settleRealAmount' />
      <f-form-item label='已结算金额2' type='number' :precision='4' data-type='number' name='settleRealAmount2' :value='formItem.settleRealAmount2' />
      <f-form-item label='已结算金额3' type='number' :precision='4' data-type='number' name='settleRealAmount3' :value='formItem.settleRealAmount3' />
      <f-form-item label='结算日期' type='date' name='settlePayDate' :value='formItem.settlePayDate' />
      <f-form-item label='结算日期2' type='date' name='settlePayDate2' :value='formItem.settlePayDate2' />
      <f-form-item label='结算日期3' type='date' name='settlePayDate3' :value='formItem.settlePayDate3' />

      <a-divider orientation='center'>开票信息</a-divider>
      <f-form-item label='与供方开票金额' type='number' :precision='4' data-type='number' name='invoicePaymentAmount' :value='formItem.invoicePaymentAmount' />
      <f-form-item label='开票税金' type='number' :precision='4' data-type='number' name='invoiceSj' :value='formItem.invoiceSj' />
      <f-form-item label='开票日期' type='date' name='invoiceAmountDate' :value='formItem.invoiceAmountDate' />
      <f-form-item label='开票单号' name='invoicePaymentNo' :value='formItem.invoicePaymentNo' />


      <a-divider orientation='center'>发票信息</a-divider>
      <f-form-item label='发票金额' type='number' :precision='4' data-type='number' name='invoiceAmount' :value='formItem.invoiceAmount' />
      <f-form-item label='发票日期' type='date' name='invoiceDate' :value='formItem.invoiceDate' />
      <f-form-item label='发票单号' name='invoiceNo' :value='formItem.invoiceNo' />
    </f-form>
  </div>
</template>
<script>
import api from "../js/api"

export default {
  name: "orderCalculateTab2",
  props: {},
  data() {
    return {
      refs: this.$refs,
      loadDept: false,
      supplieBtn: true,
      amountTitle: "回款日期",
      api: Object.assign(api, this.api),
      isAdd: true,//是否是添加模式
      loaded: false,//是否加载完成
      formItem: this.getFormItem()
    }
  },
  methods: {
    getFormItem() {
      return {
        orderId: "",
        orderNo: "",
        delivery: "",
        saleManName: "",
        customName: "",
        invoiceSendType: 0,
        reputation: "",
        reputationAmount: "",
        bankId: "",
        customBondType: 0,
        supplierBondType: 0,
        customId: "",
        billsType: "",
        remark: ""
      }
    },
    //表单赋值
    setData(data) {
      this.$refs.form.resetFields()
      this.formItem = this.getFormItem()
      if (data && data.orderDetailsId) {
        this.http.get(this, {
          url: this.api.bod.get,
          params: {
            orderDetailsId: data.orderDetailsId,
            handlerName: "calCulateTab1GetHandler"
          },
          success: function(me, data) {
            me.formItem = data
          }
        })
      }
    },
    //提交表单
    handleSubmit(callback) {
      this.$refs.form.submit({
        orderId: this.formItem.orderId,
        drugsId: this.formItem.drugsId,
        drugsLotId: this.formItem.drugsLotId,
        optType: 3,
        customId: this.formItem.customId,
        saleType: this.formItem.saleType
      }, callback)
    }
  },
  mounted() {

  },
  created() {
  },
  components: {}
}
</script>

<style scoped lang='less' rel='stylesheet/less'>

</style>
